/*
Copyright [2023] [fuwen_soft]
*/
package vip.xiaonuo.sys.modular.sysappinfoevaluation.controller;

import vip.xiaonuo.core.annotion.BusinessLog;
import vip.xiaonuo.core.annotion.Permission;
import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import vip.xiaonuo.core.pojo.page.PageResult;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import vip.xiaonuo.core.annotion.version.AdminVersionSwagger;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import vip.xiaonuo.sys.core.msg.Result;
import vip.xiaonuo.sys.modular.sysappinfoevaluation.entity.SysAppInfoEvaluation;
import vip.xiaonuo.sys.modular.sysappinfoevaluation.param.SysAppInfoEvaluationParam;
import vip.xiaonuo.sys.modular.sysappinfoevaluation.service.SysAppInfoEvaluationService;

import javax.annotation.Resource;
import java.util.List;

import static vip.xiaonuo.sys.core.msg.ResultUtils.success;

/**
 * app评价控制器
 *
 * @author yanwei
 * @date 2023-03-21 12:07:25
 */
@RestController
@Api(tags = "后台管理 app评价 相关APIS")
@AdminVersionSwagger
public class SysAppInfoEvaluationController {

    @Resource
    private SysAppInfoEvaluationService sysAppInfoEvaluationService;

    /**
     * 查询app评价
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @GetMapping("/sysAppInfoEvaluation/page")
    @BusinessLog(title = "app评价_查询", opType = LogAnnotionOpTypeEnum.QUERY)
    @ApiOperation("app评价_查询")
    public Result<PageResult<SysAppInfoEvaluation>> page(SysAppInfoEvaluationParam sysAppInfoEvaluationParam) {
        PageResult<SysAppInfoEvaluation> page = sysAppInfoEvaluationService.page(sysAppInfoEvaluationParam);
        return success(page);
    }

    /**
     * 添加app评价
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @PostMapping("/sysAppInfoEvaluation/add")
    @BusinessLog(title = "app评价_增加", opType = LogAnnotionOpTypeEnum.ADD)
    @ApiOperation("app评价_增加")
    public Result add(@RequestBody @Validated(SysAppInfoEvaluationParam.add.class) SysAppInfoEvaluationParam sysAppInfoEvaluationParam) {
            sysAppInfoEvaluationService.add(sysAppInfoEvaluationParam);
        return success();
    }

    /**
     * 删除app评价，可批量删除
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @PostMapping("/sysAppInfoEvaluation/delete")
    @BusinessLog(title = "app评价_删除", opType = LogAnnotionOpTypeEnum.DELETE)
    @ApiOperation("app评价_删除")
    public Result delete(@RequestBody @Validated(SysAppInfoEvaluationParam.delete.class) List<SysAppInfoEvaluationParam> sysAppInfoEvaluationParamList) {
            sysAppInfoEvaluationService.delete(sysAppInfoEvaluationParamList);
        return success();
    }

    /**
     * 编辑app评价
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @PostMapping("/sysAppInfoEvaluation/edit")
    @BusinessLog(title = "app评价_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
    @ApiOperation("app评价_编辑")
    public Result edit(@RequestBody @Validated(SysAppInfoEvaluationParam.edit.class) SysAppInfoEvaluationParam sysAppInfoEvaluationParam) {
            sysAppInfoEvaluationService.edit(sysAppInfoEvaluationParam);
        return success();
    }

    /**
     * 查看app评价
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @GetMapping("/sysAppInfoEvaluation/detail")
    @BusinessLog(title = "app评价_查看", opType = LogAnnotionOpTypeEnum.DETAIL)
    @ApiOperation("app评价_查看")
    public Result<SysAppInfoEvaluation> detail(@Validated(SysAppInfoEvaluationParam.detail.class) SysAppInfoEvaluationParam sysAppInfoEvaluationParam) {
        SysAppInfoEvaluation detail =   sysAppInfoEvaluationService.detail(sysAppInfoEvaluationParam);
        return success(detail);
    }

    /**
     * app评价列表
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @GetMapping("/sysAppInfoEvaluation/list")
    @BusinessLog(title = "app评价_列表", opType = LogAnnotionOpTypeEnum.QUERY)
    @ApiOperation("app评价_列表")
    public Result<List<SysAppInfoEvaluation>> list(SysAppInfoEvaluationParam sysAppInfoEvaluationParam) {
        List<SysAppInfoEvaluation> list  =   sysAppInfoEvaluationService.list(sysAppInfoEvaluationParam);
        return success(list);
    }

    /**
     * 导出系统用户
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @GetMapping("/sysAppInfoEvaluation/export")
    @BusinessLog(title = "app评价_导出", opType = LogAnnotionOpTypeEnum.EXPORT)
    @ApiOperation("app评价_导出")
    public void export(SysAppInfoEvaluationParam sysAppInfoEvaluationParam) {
        sysAppInfoEvaluationService.export(sysAppInfoEvaluationParam);
    }

}
